#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include <sys/types.h>
#include <sys/wait.h>

//测试父进程向子进程传递环境变量
int main()
{
    pid_t id = fork();
    if(id == 0)
    {
        execl("/usr/bin/ls","ls","-a","-l",NULL);
        exit(-1);
    }
    wait(NULL);
    return 0;
}